package com.cn.itcast.gjp.service;

import com.cn.itcast.gjp.controller.MyBatisUtil;
import com.cn.itcast.gjp.domain.Sort;
import com.cn.itcast.gjp.mapper.SortMapper;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class SortService {

    public List<Sort> queryAllSort(){
        SqlSession session= MyBatisUtil.getSqlSession();
        SortMapper sortMapper = session.getMapper(SortMapper.class);
        return sortMapper.queryAllSort();
    }

    public void AddSort(Sort sort){
        SqlSession session= MyBatisUtil.getSqlSession();
        SortMapper sortMapper = session.getMapper(SortMapper.class);
    }

    public void EditSort(Sort sort){
        SqlSession session= MyBatisUtil.getSqlSession();
        SortMapper sortMapper = session.getMapper(SortMapper.class);
    }

    public void DeleteSort(Sort sort) {
        SqlSession session= MyBatisUtil.getSqlSession();
        SortMapper sortMapper = session.getMapper(SortMapper.class);
        sortMapper.DeleteSort(sort);
    }
}
